﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Documents.Common.Interfaces;
using System.Xml;
using Documents.Common.Helpers;

namespace Documents.web.Helpers
{
    public class NWISRepositoryHelper : IServiceHelper
    {
        private string _documentrepositoryurl = "http://localhost:1195/Document/";
        /// <summary>
        /// Perfrom a GET on the URL
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        public XmlDocument Get(string url)
        {
                // we are being asked to retrieve a document
          Guid documentID = new Guid("a9a6aa9c-0a15-4a9e-bf9c-c2994cd4c3d5"); // known documentID.
          return XmlHelper.Get(_documentrepositoryurl + url);
        }

        /// <summary>
        /// Perfrom a POST on the URL
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        public XmlDocument Post(string url, string postData)
        {
            return XmlHelper.Post(_documentrepositoryurl + url, postData);
        }

    }
}
